"""
@author: 江同学呀
@file: match_all_queries.py
@date: 2025/1/13 21:23
@desc:
    https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-dsl-match-all-query.html
"""
from typing import Dict

from espc.common.common import Number
from espc.orm.model.dsl.queries.base_queries import _BaseQueries


class MatchAll(_BaseQueries):
    """
    匹配所有查询

    The most simple query, which matches all documents, giving them all a _score of 1.0.
    最简单的查询，匹配所有文档，使它们的所有_score均为 1.0。

    :param boost:
    """
    type: str = "match_all"

    def __init__(self, boost: Number = None):
        super().__init__()
        self._boost: Number = boost
        return

    def _build(self) -> Dict:
        _body: Dict = {}
        if self._boost is not None:
            _body["boost"] = self._boost
        return _body


class MatchNone(_BaseQueries):
    """
    Match None 查询

    This is the inverse of the match_all query, which matches no documents.
    这是 match_all 查询的反面，它不匹配任何文档。
    """
    type: str = "match_none"

    def __init__(self):
        super().__init__()
        return

    def _build(self) -> Dict:
        return {}



